package tk.winshu.consumer;

import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import tk.winshu.api.DemoResponse;
import tk.winshu.api.IDemoService;

/**
 * @author Kevin
 * @since 2019/01/10.
 */
@RestController
public class DemoController {

    @Reference(version = "1.0.0")
    private IDemoService demoService;

    @GetMapping("/")
    public String index() {
        return "Welcome";
    }

    @GetMapping("/sayHello")
    public DemoResponse sayHello(String name) {
        return demoService.sayHello(name);
    }

}
